﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DDBuildTools.DataAccess
{
    /// <summary>
    /// 数据接口
    /// </summary>
    public interface IDataBaseFactory
    {
        /// <summary>
        /// 创建数据库
        /// </summary>
        /// <returns></returns>
        IDataBase CreateDataBase();
    }

    /// <summary>
    /// Access 数据库
    /// </summary>
    public class AccessDataBaseFactory : IDataBaseFactory
    {
        /// <summary>
        /// 创建数据库
        /// </summary>
        /// <returns></returns>
        public IDataBase CreateDataBase()
        {
            return new AccessDB();
        }
    }
    /// <summary>
    /// MsSql2000 数据库
    /// </summary>
    public class MsSql2000DataBaseFactory : IDataBaseFactory
    {
        /// <summary>
        /// 创建数据库
        /// </summary>
        /// <returns></returns>
        public IDataBase CreateDataBase()
        {
            return new MsSql2000();
        }
    }

    /// <summary>
    /// MsSql2005 数据库
    /// </summary>
    public class MsSql2005DataBaseFactory : IDataBaseFactory
    {
        /// <summary>
        /// 创建数据库
        /// </summary>
        /// <returns></returns>
        public IDataBase CreateDataBase()
        {
            return new MsSql2005();
        }
    }

}
